/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import helpers.RandomGenerator;
import java.sql.Date;
import java.util.Random;

/**
 *
 * @author arnaldo
 */
public class Survey {
    private Date openDate;
    private Date closeDate;
    private Target target;

    private int id;

    private Question [] questions;

    public Survey(){
//        this.openDate =
//        this.closeDate =
        this.target = Survey.generateTarget();
        this.questions =Survey.generateQuestions();
    }

    public static Question[] generateQuestions(){
        Random r = new Random();

        int size = r.nextInt(10)+5;
        Question [] qs = new Question[size];
        for(int i=0;i<size;i++){
            qs[i] = new Question();
        }
        
        return qs;
    }
    
    public static Target generateTarget(){
        Target t = RandomGenerator.Target();
        return t;
    }

    /**
     * @return the openDate
     */
    public Date getOpenDate() {
        return openDate;
    }

    /**
     * @param openDate the openDate to set
     */
    public void setOpenDate(Date openDate) {
        this.openDate = openDate;
    }

    /**
     * @return the closeDate
     */
    public Date getCloseDate() {
        return closeDate;
    }

    /**
     * @param closeDate the closeDate to set
     */
    public void setCloseDate(Date closeDate) {
        this.closeDate = closeDate;
    }

    /**
     * @return the target
     */
    public Target getTarget() {
        return target;
    }

    /**
     * @param target the target to set
     */
    public void setTarget(Target target) {
        this.target = target;
    }

    /**
     * @return the questions
     */
    public Question[] getQuestions() {
        return questions;
    }

    /**
     * @param questions the questions to set
     */
    public void setQuestions(Question[] questions) {
        this.questions = questions;
    }

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }
}
